﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// ScrumTable for Scrum Meeting Support
// Copyright © HSR - Hochschule für Technik Rapperswil
// All Rights Reserved
// 
// Author:
//  Michael Gfeller Silvan Gehrig Patrick Boos
// 
// ---------------------------------------------------------------------
#endregion

#region Usings

using Microsoft.Practices.Unity;

#endregion

namespace ScrumTable.Common.Unity
{
    /// <summary>
    /// Contains additinal functionalities for the Microsoft Unity Fx.
    /// </summary>
    public static class UnityContainerUtil
    {
        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        /// <summary>
        /// Releases managed (c# or .net) resources.
        /// </summary>
        public static T Resolve<T>(this IUnityContainer container)
        {
            PreCondition.AssertNotNull(container, "container");

            return (T) container.Resolve(typeof (T));
        }

        #endregion
    }
}
